package com.jiajia.study.product.controller;

import com.jiajia.common.utils.R;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

@RestController
@RequestMapping("login")
public class LoginController {


    @RequestMapping("auth")
    public R auth(@RequestBody LoginVO loginVO){
        String username = loginVO.getUsername();
        String password = loginVO.getPassword();
        System.out.println("user : " +username+"password:" + password);
        R r = new R();
        r.put("code",200);
        r.put("msg","success");
        ArrayList<String> roles = new ArrayList<>();
        roles.add("admin");
        r.put("roles",roles);
        return r;
    }

}
